home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINPROGS / PCL4W10.ZIP / SIOERROR.C < prev    next >
Text File  |  1994-01-23  |  1KB  |  40 lines

  1. /*** sioerror.c ***/
  2.  
  3. #include <windows.h>
  4. #include "sioerror.h"
  5. #include "simple.h"
  6.  
  7. extern HWND hMainWnd;
  8.  
  9. static char *ErrorText[21] = {
  10.   /*  0 */      "No error.",
  11.   /* -1 */      "Timeout waiting for I/O.",
  12.   /* -2 */      "Port not enabled.",
  13.   /* -3 */      "No buffer available.",
  14.   /* -4 */      "No such port.",
  15.   /* -5 */      "Expecting 'S', 'C', or 'R' as 2nd argument.",
  16.   /* -6 */      "Expecting 'A', 'C', or 'D' as 2nd argument.",
  17.   /* -7 */      "Bad parity code.",
  18.   /* -8 */      "Bad stop bits code.",
  19.   /* -9 */      "Bad wordlength code.",
  20.  /* -10 */      "Bad buffer size code.",
  21.  /* -11 */      "Bad baud rate code.",
  22.  /* -12 */      "LOOP_BACK test fails.",
  23.  /* -13 */      "UART undefined.",
  24.  /* -14 */      "Bad or missing UART.",
  25.  /* -15 */      "Port already enabled.",
  26.  /* -16 */      "ISR already in use",
  27.  /* -17 */      "No such IRQ",
  28.  /* -18 */      "ISR limit exceeded",
  29.  /* -19 */      "Illegal Modification!",
  30.  /* other */    "No such error code."};
  31.  
  32. void SioError(int Code,char *FunMsg)
  33. {int Index = 0;
  34.  if(Code==0) Index = 0;
  35.  else
  36.    {if(Code<-19) Index = 20;
  37.     else Index = 0 - Code;
  38.    }
  39.  MessageBox(hMainWnd,ErrorText[Index],FunMsg,MB_ICONEXCLAMATION | MB_OK);
  40. } /* end SioError */